using System;

namespace Aragorn.SOA.ORM.Lambda.Adapter
{
	internal class SqlServerAdapterBase : SqlAdapterBase
	{
		public SqlServerAdapterBase()
		{
		}

		public string Field(string tableName, string fieldName)
		{
			return string.Format("[{0}].[{1}]", tableName, fieldName);
		}

		public string Parameter(string parameterId)
		{
			return string.Concat("@", parameterId);
		}

		public string QueryStringPage(string source, string selection, string conditions, string order, int pageSize)
		{
			object[] objArray = new object[] { selection, source, conditions, order, pageSize };
			return string.Format("SELECT TOP({4}) {0} FROM {1} {2} {3}", objArray);
		}

		public string Table(string tableName)
		{
			return string.Format("[{0}]", tableName);
		}
	}
}